package com.zwps.biz.domain.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zwps.biz.api.model.dto.mointordentify.RecordVideoDTO;
import com.zwps.biz.api.model.vo.monitorvideo.MonitorDeviceRecordVideoVO;
import com.zwps.biz.api.model.vo.priturersvr.PictureRsvrVo;
import com.zwps.biz.dal.db.dao.PictureRsvrDAO;
import com.zwps.biz.dal.db.object.MonitorDeviceRecordVideoDO;
import com.zwps.biz.domain.converter.MonitorRecordConverter;
import com.zwps.biz.domain.service.MonitorDeviceRecordVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zwps.biz.dal.db.dao.MonitorDeviceRecordVideoDAO;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

/**
 *
 */
@Service
public class MonitorDeviceRecordVideoServiceImpl extends ServiceImpl<MonitorDeviceRecordVideoDAO, MonitorDeviceRecordVideoDO>
        implements MonitorDeviceRecordVideoService {

    @Autowired
    private MonitorDeviceRecordVideoDAO videoDAO;
    @Autowired
    private PictureRsvrDAO pictureRsvrDAO;

    @Override
    public List<PictureRsvrVo> getVodeos() {
        return pictureRsvrDAO.getPictures();
    }

    @Override
    public void addVideos(RecordVideoDTO recordVodeoDTO) {
        MonitorDeviceRecordVideoDO alarmRecordDO = MonitorRecordConverter.INSTANCE.toAlarmRecordDO(recordVodeoDTO);
        alarmRecordDO.setCreateTime(recordVodeoDTO.getUptime());
        alarmRecordDO.setName(recordVodeoDTO.getFileName());
        alarmRecordDO.setFileUrl(recordVodeoDTO.getFilePath());
        videoDAO.insert(alarmRecordDO);
    }

}




